from Base import message, intersect, SS_VALID
from DRG import MDCJ_DRG

def group(record):
  adrg_zd = []
  adrg_zd1 = []
  adrg_ss = ["08.2000x009","18.2900x016","21.3200x010","21.9900x002","21.9901","21.9902","27.4300x010","54.3x00x011","61.3x00x005","64.2x00x006","71.3x00x021","71.3x00x023","86.2200x011","86.2201","86.2203","86.5902"]
  adrg_ss1 = []
  dept_list = []

  if True and record.ssList and record.ssList[0] in adrg_ss:
    message('符合JD2入组条件，匹配规则：主手术匹配')

    if MDCJ_DRG.JD21_group(record):
      return 'JD21'

    if MDCJ_DRG.JD23_group(record):
      return 'JD23'

    if MDCJ_DRG.JD25_group(record):
      return 'JD25'
        
    return 'JD2'
  else:
    return ''
    
